package com.shop.wk.common.dto;

import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author 日月星辰
 * @date 2020/12/25 21:49
 * @description
 */
@Data
public class ResponseResult<T> implements Serializable {

  private static final long serialVersionUID = 1L;
  private long timestamp;
  private int code;
  private String message;
  private T data;

  public ResponseResult(int code) {
    this.timestamp=System.currentTimeMillis();
    this.code = code;
  }

  public ResponseResult(int code, String message) {
    this.timestamp=System.currentTimeMillis();
    this.code = code;
    this.message = message;
  }

  public ResponseResult(int code, T data) {
    this.timestamp=System.currentTimeMillis();
    this.code = code;
    this.data = data;
  }

  public ResponseResult(int code, String message, T data) {
    this.timestamp=System.currentTimeMillis();
    this.code = code;
    this.message = message;
    this.data = data;
  }
}
